From 0fe8d37002be074fd61265b991fde74b12cb94f1 Mon Sep 17 00:00:00 2001 From: Ell Date: Wed, 30 May 2018 05:45:17 -0400 Subject: [PATCH] babl-memory: allow babl_malloc(0) to succeed Allow a babl_malloc() call with size == 0 to succeed, returning a dummy allocation, instead of asserting on this condition. The new babl-palette code tries to allocate an empty buffer for the radii array when creating a single-color palette, which would previously lead to a crash. --- babl/babl-memory.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/babl/babl-memory.c b/babl/babl-memory.c index d0229e4..f402840 100644 --- a/babl/babl-memory.c +++ b/babl/babl-memory.c @@ -111,8 +111,6 @@ babl_malloc (size_t size) char *ret; int offset; - babl_assert (size); - functions_sanity (); ret = malloc_f (BABL_ALLOC + BABL_ALIGN + size); if (!ret) -- 2.30.2